package com.aikon.wht.designPattern.consumer;

/**
 * @author haitao.wang http://www.bestwonderful.com
 */
public abstract class AbstractRunner implements Runnable {

    String name;

    Object lock;

    Product product;


    public AbstractRunner(String name, Object lock, Product product) {
        this.name = name;
        this.lock = lock;
        this.product = product;
    }


    @Override
    public void run() {
        Thread.currentThread().setName(name);
        try {
            this.execute();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    protected abstract void execute() throws InterruptedException;
}
